<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org/">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link th:href="@{/webjars/bootstrap/5.2.3/css/bootstrap.css}"
          href="../static/bootstrap-5.3.0/css/bootstrap.css" rel="stylesheet"/>
    <script th:src="@{/webjars/jquery/3.6.4/jquery.min.js}" src="../static/jquery/3.6.4/jquery.min.js"></script>

</head>
<body>
<table class="table table-striped table-hover">
    <tr>
        <td>ID</td>
        <td>标签</td>
        <td>名字</td>
        <td>操作</td>
    </tr>
    <tr th:each="shebei:${list}">
        <td th:text="${shebei.id}"></td>
        <td th:text="${shebei.getLabel()}"></td>
        <td th:text="${shebei.getName()}"></td>
        <td >
            <button type="button" class="btn btn-danger" th:onclick="deleteByID([[${shebei.id}]])">删除</button>
        </td>
    </tr>
</table>
</body>

<script>
    const deleteByID=(id)=>{
        window.location.href="/shebei/delete/"+id
    }

</script>
</html>